package com.sky.api.client;


import com.sky.api.config.DefaultFeignConfig;
import com.sky.dto.ShoppingCartDTO;
import com.sky.entity.ShoppingCart;
import com.sky.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "cart-service-user",configuration = {DefaultFeignConfig.class})
public interface CartClient {
    @GetMapping("/user/shoppingCart/list")
    Result<List<ShoppingCart>> listAll();

    @DeleteMapping("/user/shoppingCart/clean")
    Result clean();


    @PostMapping("/user/shoppingCart/add")
    Result insert(@RequestBody ShoppingCartDTO shoppingCartDTO);

}
